package com.qlm.controller;

import java.util.List;

import com.jfinal.aop.Before;
import com.jfinal.core.Controller;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import com.qlm.interceptor.AuthInterceptor;

@Before(AuthInterceptor.class)
public class CommentController extends Controller{
	public void index(){
		List<Record> find = Db.find("select * from t_comment where isgood is null order by time_ desc");
		renderJson(find);
	}
	
	public void go(){
		String id = getPara("id");
		Db.update("update t_comment set isgood = 1 where id = "+id);
		renderJson(new Record());
	}
}
